
<?php
$id=$_GET['id'];
include '../config/db_config.php';
include '../lib/kelola_technopreneur.php';
include '../lib/kelola_produk.php';
include '../lib/kelola_review.php';
include '../lib/kelola_gambar.php';

$kelolaTechnopreneur = new kelola_technopreneur();
$kelolaProduk = new kelola_produk();
$kelolaReview = new kelola_review();
$kelolaGambar = new kelola_gambar();

$res=$kelolaProduk->select_produk_by_technopreneur($id);

while ($row = mysql_fetch_assoc($res)){
	$kelolaReview->delete_all_review ($row['ID_PRODUK']);
	$kelolaGambar->delete_all_gambar ($row['ID_PRODUK']);
}

$kelolaProduk->delete_all_produk($id);
$kelolaTechnopreneur->delete_technopreneur($_GET['id']);

header('location:viewKelolaTechno.php?message=success');

?>